package com.example.notepadtxx.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DBUtils {
    public static final String DATABASE_NAME = "NotePad.db";//数据库名字
    public static final String DATABASE_TABLE = "Note";//表名
    public static final int DATABASE_VERSION = 1;//数据库版本

    //数据库列名
    public static final String NOTEPAD_ID ="id";
    public static final String NOTEPAD_CONTENT = "content";
    public static final String NOTEPAD_TIME ="notetime";

    //定义创建表的sql语句
    public static final String sql ="create table "+ DATABASE_TABLE
            +"(id integer primary key autoincrement, content text, notetime text)";
    //获取当前日期
    public static final String getTime(){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
        Date date = new Date(System.currentTimeMillis());
        return simpleDateFormat.format(date);
    }
}
